package innerdemo;
class OutClass{
    public int data1 = 1111;
    public int data2 = 2;
    public static int data3 = 3;
    class InnerClass{
        public int data1 = 1;
        public int data4 = 4;
        public int data5 = 5;
//      public static int data6 = 6;
        //实例内部类中不能定义静态成员，如果定义要加final

        public InnerClass(){
            System.out.println("实例内部类的构造方法");
        }
        public void innerfunc(){
            System.out.println(data1);
            System.out.println(data4);
            System.out.println(OutClass.this.data1);
            System.out.println("实例内部类的普通方法");
        }
//        public static void staticfunc(){
//
//        }
    }
}
public class Test {
    public static void main(String[] args) {
        OutClass outClass = new OutClass();
        OutClass.InnerClass innerClass = new OutClass().new InnerClass();
        innerClass.innerfunc();
    }
}
